﻿<%@ Control Language="C#" %>
<%@ Register src="../module/Admincenter-Types-DBColumn-List-Select.ascx" tagname="DBColumnList" tagprefix="inal" %>
<script runat="server">
    private int type = 0;
    private int root_id = 0;
    private string Keepurl = "#";
    private int Item_Lang = 1;
    private string defaultText = Lang.Show("SelectItem");
    protected void Page_Load(object sender, EventArgs e)
    {
        Item_Lang = Utils.GetQueryString("lang", 1);
        Types types = new Types();
        if (Type == 0)
            Type = Utils.GetQueryString("obj_typ", 1);
        RepeaterDefault.DataSource = types.List(Root_Id, Type, Item_Lang);
        RepeaterDefault.DataBind();
    }
    /// <summary>
    /// 对象类型
    /// </summary>
    public int Type
    {
        get { return type; }
        set { type = value; }
    }
    /// <summary>
    /// 跟目录ID
    /// </summary>
    public int Root_Id
    {
        get { return root_id; }
        set { root_id = value; }
    }
    /// <summary>
    /// 默认选择文本，默认文本是：XML:SelectItem
    /// </summary>
    public string DefaultText
    {
        get { return defaultText; }
        set { defaultText = value; }
    } 
</script>
<select  id="Typ<%=Type+"_"+Root_Id %>">
    <option value="0"><%=DefaultText %></option>
    <asp:Repeater runat="server" ID="RepeaterDefault">
        <ItemTemplate><option value="<%#Eval("id") %>">[<%#Eval("Id","{0:000}") %>] - <%#Eval("Name") %></option><inal:DBColumnList runat="server" Root_Id='<%#Utils.ToInt(Container.DataItem,"Id") %>' Type='<%#Utils.ToInt(Container.DataItem,"Type") %>' Item_Lang='<%#Utils.ToInt(Container.DataItem,"Lang") %>' />
        </ItemTemplate>
    </asp:Repeater>
</select>